package com.allwees.bs.module.pms.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.allwees.bs.core.modelbase.entity.BaseEntity;
import com.allwees.core.common.constant.EStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.persistence.Column;

/**
 * Product上下架记录
 *
 * @author yangylsky
 * @since 2019-12-19
 *
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper=true)
@Accessors(chain = true)
@NoArgsConstructor
@TableName("pms_product_onoff_log")
public class ProductOnoffLog extends BaseEntity {
	private static final long serialVersionUID = -2027388783246954086L;
	/**
	 * <ul>执行操作后的状态，应为这几个状态：
	 * <li>上架：EStatus.NORMAL</li>
	 * <li>下架：EStatus.INITIATIVE_PUTOFF，EStatus.PASSIVE_PUTOFF</li>
	 * </ul>
	 */
	@Column(nullable = false)
	private EStatus actionStatus;

	/**
	 * Product uuid
	 */
	@Column(length = 48)
	private String productUuid;

	@Column(length = 48)
	private String supplierUuid;

	@Column(length = 48)
	private String retailerUuid;

	/**
	 * 操作员uuid
	 */
	@Column(length = 48)
	private String operatorUuid;

	@Column(length = 48)
	private String reason;

	private String remark;

	public String getActionStatusDesc() {
		return actionStatus.desc();
	}
}
